package com.dhcc.DRGsHosp.facade.impl.assembler;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.dhcc.DRGsHosp.core.domain.SizerCondition;
import com.dhcc.DRGsHosp.facade.dto.SizerConditionDTO;


public class SizerConditionAssembler {
	
	public static SizerConditionDTO  toDTO(SizerCondition  SizerCondition){
		if (SizerCondition == null) {
			return null;
		}
    	SizerConditionDTO result  = new SizerConditionDTO();
	    	result.setConditionValue(SizerCondition.getConditionValue());
 	    	result.setMoudkeCode(SizerCondition.getMoudkeCode());
 	    	result.setRoleCode(SizerCondition.getRoleCode());
 	    	result.setUserCode(SizerCondition.getUserCode());
     	    return result;
	 }
	
	public static List<SizerConditionDTO>  toDTOs(Collection<SizerCondition>  sizerConditions){
		if (sizerConditions == null) {
			return null;
		}
		List<SizerConditionDTO> results = new ArrayList<SizerConditionDTO>();
		for (SizerCondition each : sizerConditions) {
			results.add(toDTO(each));
		}
		return results;
	}
	
	 public static SizerCondition  toEntity(SizerConditionDTO  sizerConditionDTO){
	 	if (sizerConditionDTO == null) {
			return null;
		}
	 	SizerCondition result  = new SizerCondition();
	 	result.setConditionValue(sizerConditionDTO.getConditionValue());
    	result.setMoudkeCode(sizerConditionDTO.getMoudkeCode());
    	result.setRoleCode(sizerConditionDTO.getRoleCode());
    	result.setUserCode(sizerConditionDTO.getUserCode());
 	  	return result;
	 }
	
	public static List<SizerCondition> toEntities(Collection<SizerConditionDTO> sizerConditionDTOs) {
		if (sizerConditionDTOs == null) {
			return null;
		}
		List<SizerCondition> results = new ArrayList<SizerCondition>();
		for (SizerConditionDTO each : sizerConditionDTOs) {
			results.add(toEntity(each));
		}
		return results;
	}
}
